<template>
    <div class="banner">
      <!--列表-->
      <el-table :data="recordList" highlight-current-row class="el-table-style">
        <el-table-column type="index" min-width="60">
        </el-table-column>
        <el-table-column prop="product_name" label="名称" min-width="100">
        </el-table-column>
        <el-table-column prop="amount" label="总金额" min-width="100">
        </el-table-column>
        <el-table-column prop="unit_name" label="公司名称" min-width="100">
        </el-table-column>
        <el-table-column prop="Invoice_tax_number" label="税号" min-width="100">
        </el-table-column>
        <el-table-column label="单位地址" min-width="100">
          <template slot-scope="scope">
            <p>{{scope.row.unit_province}}{{scope.row.unit_city}}{{scope.row.unit_area}}{{scope.row.unit_address}}</p>
          </template>
        </el-table-column>
        <el-table-column prop="unit_phone" label="公司电话" min-width="100">
        </el-table-column>
        <el-table-column prop="bank_account" label="开户银行" min-width="100">
        </el-table-column>
        <el-table-column prop="bank_account_num" label="银行账号" min-width="100">
        </el-table-column>
        <el-table-column prop="created_at" label="创建时间" min-width="100">
        </el-table-column>
<!--        <el-table-column label="操作" min-width="150">-->
<!--          <template slot-scope="scope">-->
<!--            <el-button type="primary" size="mini">查看</el-button>-->
<!--            <el-button type="danger" class="danger-btn" size="mini" >下载</el-button>-->
<!--          </template>-->
<!--        </el-table-column>-->
      </el-table>
      <el-col :span="24" class="footer-bar">
        <!-- <div class="batch"><el-button size="medium ">批量删除</el-button></div> -->
        <div class="page-code">
          <el-pagination
            background
            layout="prev, pager, next"
            :total="pageTotal"
            :page-size="limit"
            @current-change="getInvoiceRecordList"
          >
          </el-pagination>
        </div>
      </el-col>
    </div>
</template>

<script>
    export default {
      name: "receipt_record",
      data(){
        return{
          recordList:[],
          pageTotal: 0,
          limit: 10
        }
      },
      mounted(){
        this.getInvoiceRecordList()
      },
      methods:{
        async getInvoiceRecordList(page){
          let params = {
            page: page||1,
            limit: this.limit
          }
          const res = await this.$api.getInvoiceRecordList(params);
          if (res.data.level == 'success'){
            this.recordList = res.data.data;
            this.pageTotal = res.data.page_info.total;
          } else {
            this.$message({
              message: res.data.message,
              type: 'warning'
            });
          }
        }
      }
    }
</script>

<style lang='scss' scoped>
  .banner{
    .action-bar{
      background-color: #f2f2f2;
      height: 60px;
      margin: 10px 0px;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      padding-left: 20px;
      .action-bar-input{
        width: 250px;
        margin-right: 14px;
      }
    }
    .el-table-style{
      width: 100%;
      border: 1px solid #f2f2f2;
    }
    .footer-bar{
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #f2f2f2;
      padding: 8px;
      margin: 10px 0px;
      box-sizing: border-box;
    }
    .dialog-footer{
      text-align: center;
    }
  }
</style>

<style>
  .el-pagination.is-background .el-pager li,
  .el-pagination.is-background .btn-prev,
  .el-pagination.is-background .btn-next
  {
    background-color: #fff;
    border: 1px solid #f1f1f1;
    margin: 0;
  }
  .member .el-dialog__body{overflow: auto;}
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
</style>
